package cn.iocoder.yudao.module.blog.dal.mysql.caselike;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.blog.dal.dataobject.caselike.BlogCaseLikeDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.blog.controller.admin.caselike.vo.*;

/**
 * 案例点赞 Mapper
 *
 * @author 曹建伟
 */
@Mapper
public interface BlogCaseLikeMapper extends BaseMapperX<BlogCaseLikeDO> {

    default PageResult<BlogCaseLikeDO> selectPage(BlogCaseLikePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BlogCaseLikeDO>()
                .eqIfPresent(BlogCaseLikeDO::getMemberId, reqVO.getMemberId())
                .betweenIfPresent(BlogCaseLikeDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(BlogCaseLikeDO::getId));
    }

    default List<BlogCaseLikeDO> selectList(BlogCaseLikeExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<BlogCaseLikeDO>()
                .eqIfPresent(BlogCaseLikeDO::getMemberId, reqVO.getMemberId())
                .betweenIfPresent(BlogCaseLikeDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(BlogCaseLikeDO::getId));
    }

}
